#include "ndame.h"
Go to the source code of this file.
Functions | |
void | state (struct data *d1, int istate) |
state |
Definition in file state.c.
|
state This function prints the status from this programme on screen. First words like boardsize, singlestep etc. will be printed on lower screen. Then the file reads the values from the struct d1 and prints them behind the words. By using istate only this status which you want to update will be updated.To set default values Istate=0 will update all values.
Definition at line 30 of file state.c. Referenced by main(), and options(). 00031 { 00032 00033 if(!istate) //prints the text by istate=0 00034 { 00035 gotoxy(2,22); 00036 printf("Bordersize="); 00037 gotoxy(28,22); 00038 printf("Singlestep="); 00039 gotoxy(54,22); 00040 printf("Save="); 00041 gotoxy(2,24); 00042 printf("File="); 00043 gotoxy(28,24); 00044 printf("Solutions="); 00045 gotoxy(54,24); 00046 printf("Calctime="); 00047 } 00048 00049 if(istate==0||istate==1) //prints value of chessboard length 00050 { 00051 gotoxy(13,22); 00052 printf(" "); 00053 gotoxy(13,22); 00054 printf("%d x %d",d1->iblength,d1->iblength); 00055 } 00056 00057 if(istate==0||istate==2) //prints value of single step status 00058 { 00059 gotoxy(39,22); 00060 printf(" "); 00061 gotoxy(39,22); 00062 if(d1->m1==automatic) 00063 { 00064 printf("no"); 00065 } 00066 else 00067 { 00068 printf("yes"); 00069 } 00070 } 00071 00072 if(istate==0||istate==3) //prints value of save status 00073 { 00074 gotoxy(59,22); 00075 printf(" "); 00076 gotoxy(59,22); 00077 if(d1->isave) 00078 { 00079 printf("yes"); 00080 } 00081 else 00082 { 00083 printf("no"); 00084 } 00085 } 00086 00087 if(istate==0||istate==4) //prints filename 00088 { 00089 gotoxy(7,24); 00090 printf(" "); 00091 gotoxy(7,24); 00092 printf("%s",d1->cfilename); 00093 } 00094 00095 if(istate==0||istate==5) //prints value of solutions 00096 { 00097 gotoxy(38,24); 00098 //printf(" "); 00099 gotoxy(38,24); 00100 printf("%d ",d1->isolutions); 00101 } 00102 00103 if(istate==0||istate==6) //prints value of calculation time 00104 { 00105 gotoxy(63,24); 00106 printf(" "); 00107 gotoxy(63,24); 00108 printf("%.3f sec",d1->fcalctime); 00109 } 00110 }
|